/*全局公用调试方法 开始*/
function dump(s){
	return console.log(s);
}
/*全局公用调试方法 结束*/

/**
 * 库：iScroll
 * 作者：Matteo Spinelli, http://cubiq.org/
 * 版本：Version 3.7.1 - Last updated: 2010.10.08
 * 基库：无
 */
(function(){
	function iScroll (el, options) {
		var that = this, i;

		that.element = typeof el == 'string' ?  document.querySelector(el):el;
		that.wrapper = that.element.parentNode;

		that.element.style.webkitTransitionProperty = '-webkit-transform';
		that.element.style.webkitTransitionTimingFunction = 'cubic-bezier(0,0,0.25,1)';
		that.element.style.webkitTransitionDuration = '0';
		that.element.style.webkitTransform = translateOpen + '0,0' + translateClose;

		// Default options
		that.options = {
			bounce: has3d,
			momentum: has3d,
			checkDOMChanges: true,
			topOnDOMChanges: false,
			hScrollbar: has3d,
			vScrollbar: has3d,
			fadeScrollbar: isIthing || !isTouch,
			shrinkScrollbar: isIthing || !isTouch,
			desktopCompatibility: false,
			overflow: 'auto',
			snap: false,
			bounceLock: false,
			scrollbarColor: 'rgba(0,0,0,0.5)',
			onScrollEnd: function () {},
			onTouchMove:function(){},
			onTouchStart:function(){},
			onTouchEnd:function(){}
		};
		
		// User defined options
		if (typeof options == 'object') {
			for (i in options) {
				that.options[i] = options[i];
			}
		}

		if (that.options.desktopCompatibility) {
			that.options.overflow = 'hidden';
		}
		
		that.onScrollEnd = that.options.onScrollEnd;
		delete that.options.onScrollEnd;

		that.onTouchMove = that.options.onTouchMove;
		delete that.options.onTouchMove;

		that.onTouchStart = that.options.onTouchStart;
		delete that.options.onTouchStart;

		that.onTouchEnd = that.options.onTouchEnd;
		delete that.options.onTouchEnd;
		
		that.wrapper.style.overflow = that.options.overflow;
		that.refresh();
		window.addEventListener('onorientationchange' in window ? 'orientationchange' : 'resize', that, false);

		if (isTouch || that.options.desktopCompatibility) {
			that.element.addEventListener(START_EVENT, that, false);
			that.element.addEventListener(MOVE_EVENT, that, false);
			that.element.addEventListener(END_EVENT, that, false);
		}
		
		if (that.options.checkDOMChanges) {
			that.element.addEventListener('DOMSubtreeModified', that, false);
		}
	}

	iScroll.prototype = {
		x: 0,
		y: 0,
		enabled: true,

		handleEvent: function (e) {
			
			var that = this;
			
			switch (e.type) {
				case START_EVENT:
					that.touchStart(e);
					break;
				case MOVE_EVENT:
					that.touchMove(e);
					break;
				case END_EVENT:
					that.touchEnd(e);
					break;
				case 'webkitTransitionEnd':
					that.transitionEnd();
					break;
				case 'orientationchange':
					
				case 'resize':
					that.refresh();
					break;
				case 'DOMSubtreeModified':
					
					that.onDOMModified(e);
					break;
			}
		},
		
		onDOMModified: function (e) {
			var that = this;

			// (Hopefully) execute onDOMModified only once
			if (e.target.parentNode != that.element) {
				return;
			}

			setTimeout(function () { that.refresh(); }, 0);

			if (that.options.topOnDOMChanges && (that.x!=0 || that.y!=0)) {
				that.scrollTo(0,0,'0');
			}
		},

		refresh: function () {
			var that = this,
				resetX = that.x, resetY = that.y,
				snap;
			
			that.scrollWidth = that.wrapper.clientWidth;
			that.scrollHeight = that.wrapper.clientHeight;
			that.scrollerWidth = that.element.offsetWidth;
			that.scrollerHeight = that.element.offsetHeight;
			that.maxScrollX = that.scrollWidth - that.scrollerWidth;
			that.maxScrollY = that.scrollHeight - that.scrollerHeight;
			that.directionX = 0;
			that.directionY = 0;

			if (that.scrollX) {
				if (that.maxScrollX >= 0) {
					resetX = 0;
				} else if (that.x < that.maxScrollX) {
					resetX = that.maxScrollX;
				}
			}
			if (that.scrollY) {
				if (that.maxScrollY >= 0) {
					resetY = 0;
				} else if (that.y < that.maxScrollY) {
					resetY = that.maxScrollY;
				}
			}

			// Snap
			if (that.options.snap) {
				that.maxPageX = -Math.floor(that.maxScrollX/that.scrollWidth);
				that.maxPageY = -Math.floor(that.maxScrollY/that.scrollHeight);

				snap = that.snap(resetX, resetY);
				resetX = snap.x;
				resetY = snap.y;
			}

			if (resetX!=that.x || resetY!=that.y) {
				that.setTransitionTime('0');
				that.setPosition(resetX, resetY, true);
			}
			
			that.scrollX = that.scrollerWidth > that.scrollWidth;
			that.scrollY = !that.options.bounceLock && !that.scrollX || that.scrollerHeight > that.scrollHeight;

			// Update horizontal scrollbar
			//alert(that.scrollerHeight > that.scrollHeight);
			if (that.options.hScrollbar && that.scrollX) {
				that.scrollBarX = that.scrollBarX || new scrollbar('horizontal', that.wrapper, that.options.fadeScrollbar, that.options.shrinkScrollbar, that.options.scrollbarColor);
				that.scrollBarX.init(that.scrollWidth, that.scrollerWidth);
			} else if (that.scrollBarX) {
				that.scrollBarX = that.scrollBarX.remove();
			}

			// Update vertical scrollbar
			if (that.options.vScrollbar && that.scrollY&&that.scrollerHeight > that.scrollHeight) {
			
				that.scrollBarY = that.scrollBarY || new scrollbar('vertical', that.wrapper, that.options.fadeScrollbar, that.options.shrinkScrollbar, that.options.scrollbarColor);
				that.scrollBarY.init(that.scrollHeight, that.scrollerHeight);
			} else if (that.scrollBarY) {
				that.scrollBarY = that.scrollBarY.remove();
			}
		},

		setPosition: function (x, y, hideScrollBars) {
			var that = this;
			
			that.x = x;
			that.y = y;

			that.element.style.webkitTransform = translateOpen + that.x + 'px,' + that.y + 'px' + translateClose;

			// Move the scrollbars
			if (!hideScrollBars) {
				if (that.scrollBarX) {
					that.scrollBarX.setPosition(that.x);
				}
				if (that.scrollBarY) {
					that.scrollBarY.setPosition(that.y);
				}
			}
		},
		
		setTransitionTime: function(time) {
			var that = this;
			
			time = time || '0';
			that.element.style.webkitTransitionDuration = time;
			
			if (that.scrollBarX) {
				that.scrollBarX.bar.style.webkitTransitionDuration = time;
				that.scrollBarX.wrapper.style.webkitTransitionDuration = has3d && that.options.fadeScrollbar ? '300ms' : '0';
			}
			if (that.scrollBarY) {
				that.scrollBarY.bar.style.webkitTransitionDuration = time;
				that.scrollBarY.wrapper.style.webkitTransitionDuration = has3d && that.options.fadeScrollbar ? '300ms' : '0';
			}
		},
			
		touchStart: function(e) {
			this.refresh();//在触摸开始时刷新一下，可修复DOMContentLoaded事件没等link的样式进来就解释
			//this.element.querySelector('.content').style.cssText="pointer-events:none;";
			this.onTouchStart();
			var that = this,
				matrix;
			
			if (!that.enabled) {
				return;
			}

			e.preventDefault();
			e.stopPropagation();
			
			that.scrolling = true;		// This is probably not needed, but may be useful if iScroll is used in conjuction with other frameworks

			that.moved = false;
			that.distX = 0;
			that.distY = 0;

			that.setTransitionTime('0');

			// Check if the scroller is really where it should be
			if (that.options.momentum || that.options.snap) {
				matrix = new WebKitCSSMatrix(window.getComputedStyle(that.element).webkitTransform);
				if (matrix.e != that.x || matrix.f != that.y) {
					document.removeEventListener('webkitTransitionEnd', that, false);
					that.setPosition(matrix.e, matrix.f);
					that.moved = true;
				}
			}

			that.touchStartX = isTouch ? e.changedTouches[0].pageX : e.pageX;
			that.scrollStartX = that.x;

			that.touchStartY = isTouch ? e.changedTouches[0].pageY : e.pageY;
			that.scrollStartY = that.y;

			that.scrollStartTime = e.timeStamp;

			that.directionX = 0;
			that.directionY = 0;
			
		},
		
		touchMove: function(e) {
			var that = this,
				pageX = isTouch ? e.changedTouches[0].pageX : e.pageX,
				pageY = isTouch ? e.changedTouches[0].pageY : e.pageY,
				leftDelta = that.scrollX ? pageX - that.touchStartX : 0,
				topDelta = that.scrollY ? pageY - that.touchStartY : 0,
				newX = that.x + leftDelta,
				newY = that.y + topDelta;
			this.onTouchMove(that.y);
			if (!this.scrolling) {
				return;
			}

			

			//e.preventDefault();
			e.stopPropagation();	// Stopping propagation just saves some cpu cycles (I presume)
			
			that.touchStartX = pageX;
			that.touchStartY = pageY;

			// Slow down if outside of the boundaries
			if (newX >= 0 || newX < that.maxScrollX) {
				newX = that.options.bounce ? Math.round(that.x + leftDelta / 3) : (newX >= 0 || that.maxScrollX>=0) ? 0 : that.maxScrollX;
			}
			if (newY >= 0 || newY < that.maxScrollY) { 
				newY = that.options.bounce ? Math.round(that.y + topDelta / 3) : (newY >= 0 || that.maxScrollY>=0) ? 0 : that.maxScrollY;
			}

			if (that.distX + that.distY > 5) {			// 5 pixels threshold

				// Lock scroll direction
				if (that.distX-3 > that.distY) {
					newY = that.y;
					topDelta = 0;
				} else if (that.distY-3 > that.distX) {
					newX = that.x;
					leftDelta = 0;
				}

				that.setPosition(newX, newY);
				that.moved = true;
				that.directionX = leftDelta > 0 ? -1 : 1;
				that.directionY = topDelta > 0 ? -1 : 1;
			} else {
				that.distX+= Math.abs(leftDelta);
				that.distY+= Math.abs(topDelta);
				//that.dist+= Math.abs(leftDelta) + Math.abs(topDelta);
			}
			
		},
		
		touchEnd: function(e) {
			//this.element.querySelector('.content').style.cssText="";
			this.onTouchEnd();
			if (!this.scrolling) {
				return;
			}

			var that = this,
				time = e.timeStamp - that.scrollStartTime,
				point = isTouch ? e.changedTouches[0] : e,
				target, ev,
				momentumX, momentumY,
				newDuration = 0,
				newPositionX = that.x, newPositionY = that.y,
				snap;

			that.scrolling = false;

			if (!that.moved) {
				that.resetPosition();

				if (isTouch) {
					// Find the last touched element
					target = point.target;
					while (target.nodeType != 1) {
						target = target.parentNode;
					}

					// Create the fake event
					ev = document.createEvent('MouseEvents');
					ev.initMouseEvent('click', true, true, e.view, 1,
						point.screenX, point.screenY, point.clientX, point.clientY,
						e.ctrlKey, e.altKey, e.shiftKey, e.metaKey,
						0, null);
					ev._fake = true;
					target.dispatchEvent(ev);
				}

				return;
			}

			if (!that.options.snap && time > 250) {			// Prevent slingshot effect
				that.resetPosition();
				return;
			}

			if (that.options.momentum) {
				momentumX = that.scrollX === true
					? that.momentum(that.x - that.scrollStartX,
									time,
									that.options.bounce ? -that.x + that.scrollWidth/5 : -that.x,
									that.options.bounce ? that.x + that.scrollerWidth - that.scrollWidth + that.scrollWidth/5 : that.x + that.scrollerWidth - that.scrollWidth)
					: { dist: 0, time: 0 };

				momentumY = that.scrollY === true
					? that.momentum(that.y - that.scrollStartY,
									time,
									that.options.bounce ? -that.y + that.scrollHeight/5 : -that.y,
									that.options.bounce ? (that.maxScrollY < 0 ? that.y + that.scrollerHeight - that.scrollHeight : 0) + that.scrollHeight/5 : that.y + that.scrollerHeight - that.scrollHeight)
					: { dist: 0, time: 0 };

				newDuration = Math.max(Math.max(momentumX.time, momentumY.time), 1);		// The minimum animation length must be 1ms
				newPositionX = that.x + momentumX.dist;
				newPositionY = that.y + momentumY.dist;
			}

			if (that.options.snap) {
				snap = that.snap(newPositionX, newPositionY);
				newPositionX = snap.x;
				newPositionY = snap.y;
				newDuration = Math.max(snap.time, newDuration);
				
			}
			that.scrollTo(newPositionX, newPositionY, newDuration + 'ms');
			
		},

		transitionEnd: function () {
			var that = this;
			document.removeEventListener('webkitTransitionEnd', that, false);
			that.resetPosition();
		},

		resetPosition: function () {
			var that = this,
				resetX = that.x,
				resetY = that.y;

			if (that.x >= 0) {
				resetX = 0;
			} else if (that.x < that.maxScrollX) {
				resetX = that.maxScrollX;
			}

			if (that.y >= 0 || that.maxScrollY > 0) {
				resetY = 0;
			} else if (that.y < that.maxScrollY) {
				resetY = that.maxScrollY;
			}
			
			if (resetX != that.x || resetY != that.y) {
				that.scrollTo(resetX, resetY);
			} else {
				if (that.moved) {
					that.onScrollEnd();		// Execute custom code on scroll end
					that.moved = false;
				}

				// Hide the scrollbars
				if (that.scrollBarX) {
					that.scrollBarX.hide();
				}
				if (that.scrollBarY) {
					that.scrollBarY.hide();
				}
			}
		},
		
		snap: function (x, y) {
			var that = this, time;

			if (that.directionX > 0) {
				x = Math.floor(x/that.scrollWidth);
			} else if (that.directionX < 0) {
				x = Math.ceil(x/that.scrollWidth);
			} else {
				x = Math.round(x/that.scrollWidth);
			}
			that.pageX = -x;
			x = x * that.scrollWidth;
			if (x > 0) {
				x = that.pageX = 0;
			} else if (x < that.maxScrollX) {
				that.pageX = that.maxPageX;
				x = that.maxScrollX;
			}

			if (that.directionY > 0) {
				y = Math.floor(y/that.scrollHeight);
			} else if (that.directionY < 0) {
				y = Math.ceil(y/that.scrollHeight);
			} else {
				y = Math.round(y/that.scrollHeight);
			}
			that.pageY = -y;
			y = y * that.scrollHeight;
			if (y > 0) {
				y = that.pageY = 0;
			} else if (y < that.maxScrollY) {
				that.pageY = that.maxPageY;
				y = that.maxScrollY;
			}

			// Snap with constant speed (proportional duration)
			time = Math.round(Math.max(
					Math.abs(that.x - x) / that.scrollWidth * 500,
					Math.abs(that.y - y) / that.scrollHeight * 500
				));
				
			return { x: x, y: y, time: time };
		},

		scrollTo: function (destX, destY, runtime) {
			var that = this;

			if (that.x == destX && that.y == destY) {
				that.resetPosition();
				return;
			}

			that.moved = true;
			that.setTransitionTime(runtime || '350ms');
			that.setPosition(destX, destY);

			if (runtime==='0' || runtime=='0s' || runtime=='0ms') {
				that.resetPosition();
			} else {
				document.addEventListener('webkitTransitionEnd', that, false);	// At the end of the transition check if we are still inside of the boundaries
			}
		},
		
		scrollToPage: function (pageX, pageY, runtime) {
			var that = this, snap;

			if (!that.options.snap) {
				that.pageX = -Math.round(that.x / that.scrollWidth);
				that.pageY = -Math.round(that.y / that.scrollHeight);
			}

			if (pageX == 'next') {
				pageX = ++that.pageX;
			} else if (pageX == 'prev') {
				pageX = --that.pageX;
			}

			if (pageY == 'next') {
				pageY = ++that.pageY;
			} else if (pageY == 'prev') {
				pageY = --that.pageY;
			}

			pageX = -pageX*that.scrollWidth;
			pageY = -pageY*that.scrollHeight;

			snap = that.snap(pageX, pageY);
			pageX = snap.x;
			pageY = snap.y;

			that.scrollTo(pageX, pageY, runtime || '500ms');
		},

		scrollToElement: function (el, runtime) {
			el = typeof el == 'object' ? el : this.element.querySelector(el);

			if (!el) {
				return;
			}

			var that = this,
				x = that.scrollX ? -el.offsetLeft : 0,
				y = that.scrollY ? -el.offsetTop : 0;

			if (x >= 0) {
				x = 0;
			} else if (x < that.maxScrollX) {
				x = that.maxScrollX;
			}

			if (y >= 0) {
				y = 0;
			} else if (y < that.maxScrollY) {
				y = that.maxScrollY;
			}

			that.scrollTo(x, y, runtime);
		},

		momentum: function (dist, time, maxDistUpper, maxDistLower) {
			var friction = 2.5,
				deceleration = 1.2,
				speed = Math.abs(dist) / time * 1000,
				newDist = speed * speed / friction / 1000,
				newTime = 0;

			// Proportinally reduce speed if we are outside of the boundaries 
			if (dist > 0 && newDist > maxDistUpper) {
				speed = speed * maxDistUpper / newDist / friction;
				newDist = maxDistUpper;
			} else if (dist < 0 && newDist > maxDistLower) {
				speed = speed * maxDistLower / newDist / friction;
				newDist = maxDistLower;
			}
			
			newDist = newDist * (dist < 0 ? -1 : 1);
			newTime = speed / deceleration;

			return { dist: Math.round(newDist), time: Math.round(newTime) };
		},
		
		destroy: function (full) {
			var that = this;

			window.removeEventListener('onorientationchange' in window ? 'orientationchange' : 'resize', that, false);		
			that.element.removeEventListener(START_EVENT, that, false);
			that.element.removeEventListener(MOVE_EVENT, that, false);
			that.element.removeEventListener(END_EVENT, that, false);
			document.removeEventListener('webkitTransitionEnd', that, false);

			if (that.options.checkDOMChanges) {
				that.element.removeEventListener('DOMSubtreeModified', that, false);
			}

			if (that.scrollBarX) {
				that.scrollBarX = that.scrollBarX.remove();
			}

			if (that.scrollBarY) {
				that.scrollBarY = that.scrollBarY.remove();
			}
			
			if (full) {
				that.wrapper.parentNode.removeChild(that.wrapper);
			}
			
			return null;
		}
	};

	function scrollbar (dir, wrapper, fade, shrink, color) {
		var that = this,
			doc = document;
		
		that.dir = dir;
		that.fade = fade;
		that.shrink = shrink;
		that.uid = ++uid;

		// Create main scrollbar
		that.bar = doc.createElement('div');
		
		that.bar.style.cssText = 'position:absolute;top:0;left:0;-webkit-transition-timing-function:cubic-bezier(0,0,0.25,1);pointer-events:none;-webkit-transition-duration:0;-webkit-transition-delay:0;-webkit-transition-property:-webkit-transform;z-index:10;background:' + color + ';' +
			'-webkit-transform:' + translateOpen + '0,0' + translateClose + ';' +
			(dir == 'horizontal' ? '-webkit-border-radius:3px 2px;min-width:6px;min-height:5px' : '-webkit-border-radius:2px 3px;min-width:5px;min-height:6px');

		// Create scrollbar wrapper
		that.wrapper = doc.createElement('div');
		that.wrapper.className="scroll_bar";
		that.wrapper.style.cssText = '-webkit-mask:-webkit-canvas(scrollbar' + that.uid + that.dir + ');position:absolute;z-index:10;pointer-events:none;overflow:hidden;opacity:0;-webkit-transition-duration:' + (fade ? '300ms' : '0') + ';-webkit-transition-delay:0;-webkit-transition-property:opacity;' +
			(that.dir == 'horizontal' ? 'bottom:2px;left:2px;right:7px;height:5px' : 'top:2px;right:2px;bottom:7px;width:5px;');

		// Add scrollbar to the DOM
		that.wrapper.appendChild(that.bar);
		wrapper.appendChild(that.wrapper);
	}

	scrollbar.prototype = {
		init: function (scroll, size) {
			var that = this,
				doc = document,
				pi = Math.PI,
				ctx;

			// Create scrollbar mask
			if (that.dir == 'horizontal') {
				if (that.maxSize != that.wrapper.offsetWidth) {
					that.maxSize = that.wrapper.offsetWidth;
					ctx = doc.getCSSCanvasContext("2d", "scrollbar" + that.uid + that.dir, that.maxSize, 5);
					ctx.fillStyle = "rgb(0,0,0)";
					ctx.beginPath();
					ctx.arc(2.5, 2.5, 2.5, pi/2, -pi/2, false);
					ctx.lineTo(that.maxSize-2.5, 0);
					ctx.arc(that.maxSize-2.5, 2.5, 2.5, -pi/2, pi/2, false);
					ctx.closePath();
					ctx.fill();
				}
			} else {
				if (that.maxSize != that.wrapper.offsetHeight) {
					that.maxSize = that.wrapper.offsetHeight;
					ctx = doc.getCSSCanvasContext("2d", "scrollbar" + that.uid + that.dir, 5, that.maxSize);
					ctx.fillStyle = "rgb(0,0,0)";
					ctx.beginPath();
					ctx.arc(2.5, 2.5, 2.5, pi, 0, false);
					ctx.lineTo(5, that.maxSize-2.5);
					ctx.arc(2.5, that.maxSize-2.5, 2.5, 0, pi, false);
					ctx.closePath();
					ctx.fill();
				}
			}

			that.size = Math.max(Math.round(that.maxSize * that.maxSize / size), 6);
			that.maxScroll = that.maxSize - that.size;
			that.toWrapperProp = that.maxScroll / (scroll - size);
			that.bar.style[that.dir == 'horizontal' ? 'width' : 'height'] = that.size + 'px';
		},
		
		setPosition: function (pos) {
			var that = this;
			
			if (that.wrapper.style.opacity != '1') {
				that.show();
			}

			pos = Math.round(that.toWrapperProp * pos);

			if (pos < 0) {
				pos = that.shrink ? pos + pos*3 : 0;
				if (that.size + pos < 7) {
					pos = -that.size + 6;
				}
			} else if (pos > that.maxScroll) {
				pos = that.shrink ? pos + (pos-that.maxScroll)*3 : that.maxScroll;
				if (that.size + that.maxScroll - pos < 7) {
					pos = that.size + that.maxScroll - 6;
				}
			}

			pos = that.dir == 'horizontal'
				? translateOpen + pos + 'px,0' + translateClose
				: translateOpen + '0,' + pos + 'px' + translateClose;

			that.bar.style.webkitTransform = pos;
		},

		show: function () {
			if (has3d) {
				this.wrapper.style.webkitTransitionDelay = '0';
			}
			this.wrapper.style.opacity = '1';
		},

		hide: function () {
			if (has3d) {
				this.wrapper.style.webkitTransitionDelay = '350ms';
			}
			this.wrapper.style.opacity = '0';
		},
		
		remove: function () {
			this.wrapper.parentNode.removeChild(this.wrapper);
			return null;
		}
	};

	// Is translate3d compatible?
	var has3d = ('WebKitCSSMatrix' in window && 'm11' in new WebKitCSSMatrix()),
		// Device sniffing
		isIthing = (/iphone|ipad/gi).test(navigator.appVersion),
		isTouch = ('ontouchstart' in window),
		// Event sniffing
		START_EVENT = isTouch ? 'touchstart' : 'mousedown',
		MOVE_EVENT = isTouch ? 'touchmove' : 'mousemove',
		END_EVENT = isTouch ? 'touchend' : 'mouseup',
		// Translate3d helper
		translateOpen = 'translate' + (has3d ? '3d(' : '('),
		translateClose = has3d ? ',0)' : ')',
		// Unique ID
		uid = 0;

	// Expose iScroll to the world
	window.iScroll = iScroll;
})();

/**
 * 库：QST
 * 作者：QQShow
 * 版本：Version 1.0 2011.3.10
 * 基库：html5,iScroll
 */
(function(){
	QST={};
	window.QST=QST;
	QST.$=window.$=function(selector) {
		return new QST.init(selector);
	};
	/**
	 * 类：QST.init
	 * 作者：Joe
	 * 参数：selector[string] css选择器表达式
	 * 描述：返回QST对象
	 * 基库：html5
	 */
	QST.init=function(selector){
		var domElements;
		if(typeof selector=='string'){
			domElements=document.querySelectorAll(selector);
		}else if(typeof selector=='object'&&selector.length!=null){
			domElements=selector;
		}else{
			domElements=[selector];
		}
		this.length = domElements.length;
		for (var i = 0; i < this.length; i++) {
			this[i] = domElements[i];
		}
		return this;
		
	}
	QST.init.prototype={
		//QST对象自身遍历方法
		each:function(fn){
			for(var i=0;i<this.length;i++){
				fn(this[i],i);
			}
		},
		addClass:function(className){
			var selt=this;
			selt.each(function(e,i){
				if(!selt.hasClass(e,className)){
					if(e.className!=''){
						e.className+=(' '+className);
					}else{
						e.className+=className;
					}

				}
			});
		},
		hasClass:function(el,className){
			
			var arr=el.className.split(/\s+/);
			if(this.inArray(className,arr)!=-1){
				return true;
			}
			return false;
		},
		inArray:function( elem, array ){
			for ( var i = 0, length = array.length; i < length; i++ ){
				if ( array[i] === elem )   
				return i;
				return -1;
			}
		}
	}
	/**
	 * 方法名：QST.ready
	 * 参数：fn[function] 需要在dom完成加载时执行的代码
	 * 描述：DOMContentLoaded
	 * 注意：外联样式此刻还没进来
	 * 基库：html5,QST.DOMReady
	 */
    QST.ready = function(fn){
		return new QST.DOMReady(fn);
    };
	/**
	 * 类：QST.DOMReady
	 * 参数：fn[function] 需要在dom完成加载时执行的代码
	 * 描述：DOMContentLoaded
	 * 注意：外联样式已进来
	 */
	QST.lineFuns=[];
	QST.DOMReady = function(fn){
		var selt=this;
		selt.tempFun=function(){
			var numStyles=0;
			var links=document.getElementsByTagName("link");
			
			for(var i=0,l=links.length;i<l;i++){
				if(links[i].getAttribute("rel")=="stylesheet"){
					numStyles++;
				}
			}
			selt.interval=setInterval(function(){
				var sheets=document.styleSheets;
				var numSheets=0;
				for(var i=0,l=sheets.length;i<l;i++){
					if(sheets[i].href!=null){
						numSheets++;
					}
				}
				if(numSheets==numStyles){
					for (var i = 0; i < QST.lineFuns.length; i++) {
						QST.lineFuns[i]();
					}
					QST.lineFuns = null;clearInterval(selt.interval);
				}
			},1);
			document.removeEventListener('DOMContentLoaded', selt.tempFun, false);
		}
        if (QST.lineFuns.length == 0) {
            document.addEventListener('DOMContentLoaded',selt.tempFun, false);
        }
        QST.lineFuns.push(fn);
    };
	/**
	 * 类：viewModsNet
	 * 参数：exp[string] 元素选择器,rel为初始化显示的mod,onTransitionEnd(mod)为每次动画完成时的事件，mod为当前元素
	 * 描述：获取所有指定表达式的元素，依据rel提供的层级关系，定义一个关系链，可用于建立多层级页面
	 * 注意：固定html结构
				<div class="view_mod a" rel="1">
					内容...
					<a href="#" class="back">返回</a>
					<a href="#" class="goto" rel="1_1">去往：1_1</a>
				</div>
				<div class="view_mod b" rel="1_1">
					内容...
				</div>
				<div class="view_mod b" rel="1_2">
					内容...
				</div>
				<div class="view_mod c" rel="1_1_1">
					内容...
				</div>
	 * 基库：viewMod
	 */
	 QST.viewModsNet=function(exp,rel,onTransitionEnd,delay){
		//补全结构
		var doms=document.querySelectorAll(exp);
		var parentNode=doms[0].parentNode;
		var parentClassName=parentNode.className;
		if(parentClassName.replace('view_mod_slider','')==parentClassName){
			//结构写全就补全
			var selider=document.createElement('div');
			selider.className='view_mod_slider';
			for(var i=0;i<doms.length;i++){
				var wmName=doms[i].className;
				if(wmName.replace('view_mod','')==wmName){
					doms[i].className+=(' view_mod');
				}
				selider.appendChild(doms[i]);
			}
			var wrapper=document.createElement('div');
			wrapper.className='view_mod_wrapper';
			wrapper.appendChild(selider);
			parentNode.appendChild(wrapper);
		}
		//
		this.inViewMod=null;
		//
		var doms=document.querySelectorAll(exp);
		var viewMods=[];
		for(var i=0;i<doms.length;i++){
			var vm=new QST.viewMod(doms[i],this);
			viewMods.push(vm);
		}
		
		//
		this.selider=viewMods[0].el.parentNode;
		//动画完成事件
		var me=this;
		me.onTransitionEnd=onTransitionEnd?onTransitionEnd:null;
		var tempCallBack=function(){
			if(me.onTransitionEnd!=null){
				me.onTransitionEnd(me.inViewMod);
			}
		}
		this.selider.addEventListener('webkitTransitionEnd', tempCallBack, false);
		this.wrapper=this.selider.parentNode;
		for(var n=0;n<viewMods.length;n++){
			for(var m=0;m<viewMods.length;m++){
				if(viewMods[n].parentRel==viewMods[m].rel){//如果找到元素跟当前的元素父rel一样，则当前元素的父viewmod指向它
					viewMods[n].parentViewMod=viewMods[m];
					break;
				}
			}
		}
		this.back=function(url,afterAjaxUpdate,beforeAjaxUpdate){
			if(this.inViewMod.parentViewMod!=null){
				var rel=this.inViewMod.parentViewMod.rel;
				this.goto(rel,url,afterAjaxUpdate,beforeAjaxUpdate,'right');
			}
		}
		//依据去往指定的rel对应的视图，假如有url则视图对应内容区更新为url返回内容
		//afterAjaxUpdate(selt,e)为ajax请求完毕后执行函数,selt为目标viewmod,e为xhr返回对象，beforeAjaxUpdate(selt)为ajax发送前执行的函数
		//point为移动方向
		this.goto=function(rel,url,afterAjaxUpdate,beforeAjaxUpdate,point){
			if(rel==this.inViewMod.rel){
				return false;
			}
			for(var n=0;n<viewMods.length;n++){
				var selt=this;
				this.selider.style.webkitTransitionDuration="0";
				this.selider.style.webkitTransform="translate3d(-"+0+"px, 0px, 0px)";
				if(viewMods[n].rel==rel){
					for(var m=0;m<viewMods.length;m++){
						
						if(viewMods[m]==this.inViewMod||viewMods[m]==viewMods[n]){
							
							if(viewMods[m]==this.inViewMod){
								//viewMods[m].el.style.webkitBoxOrdinalGroup=(point=='right'?2:1);
								viewMods[m].el.style.webkitTransform="translate3d(0px, 0px, 0px)";
							}
							else{
								//viewMods[m].el.style.webkitBoxOrdinalGroup=(point=='right'?1:2);
								var offset=selt.wrapper.offsetWidth;
								viewMods[m].el.style.webkitTransform="translate3d("+(point=='right'?-offset:offset)+"px,0px,  0px)";
							}
							//viewMods[m].el.style.webkitTransform="translate3d(0px, 0px, 0px)";

						}else{
							viewMods[m].el.style.webkitTransform="translate3d(0px,-10000px,0px)";
							//viewMods[m].el.style.webkitBoxOrdinalGroup=4;
						}
					}
					
					//this.inViewMod.el.style.webkitBoxOrdinalGroup=(point=='right'?2:1);
					//var tempInViewMod=this.inViewMod;
					//在变幻焦点viewmod之前执行，原焦点的onOutShow方法
					this.inViewMod.onOutShow();
					this.inViewMod=viewMods[n];
					//变幻之后执行onInShow方法
					this.inViewMod.onInShow();
					//this.inViewMod.el.style.webkitBoxOrdinalGroup=(point=='right'?1:2);
					setTimeout(function(){
						if(delay<=0){
							delay=1;
						}
						selt.selider.style.webkitTransitionDuration=(delay?delay:300)+"ms";
						var offset=selt.wrapper.offsetWidth;
						selt.selider.style.webkitTransform="translate3d("+(point=='right'?offset:(-offset))+"px, 0px, 0px)";
					},0);
					//假如传进来的元素是带href的元素，则自动更新内容区
					if(url){
						this.inViewMod.updateByHref(url,afterAjaxUpdate?afterAjaxUpdate:null,beforeAjaxUpdate?beforeAjaxUpdate:null );
					}
					break;
				}
			}
			return false;
		}
		
		this.init=function(rel){
			if(!rel){
				var rel=viewMods[0].rel;//默认第1个view为当前view
			}
			for(var n=0;n<viewMods.length;n++){
				var selt=this;
				this.selider.style.webkitTransform="translate3d(0px, 0px, 0px)";
				if(viewMods[n].rel==rel){
					var offset=selt.wrapper.offsetWidth;
					viewMods[n].el.style.webkitTransform="translate3d(0px,0px,  0px)";
					this.inViewMod=viewMods[n];
				}else{
					viewMods[n].el.style.webkitTransform="translate3d(0px,-10000px,0px)";
				}
				
			}
		}
		this.init(rel);
		var selt=this;
		var tempFun=function(){
			for(var m=0;m<viewMods.length;m++){
				if(viewMods[m]!=selt.inViewMod){
					viewMods[m].el.style.webkitTransform="translate3d(0px, -10000px, 0px)";
				}
			}
			window.removeEventListener('onorientationchange' in window ? 'orientationchange' : 'resize',tempFun, false);
		}
		window.addEventListener('onorientationchange' in window ? 'orientationchange' : 'resize',tempFun, false);
		//获取指定rel的viewmod
		this.getViewModByRel=function(rel){
			for(var n=0;n<viewMods.length;n++){
				if(viewMods[n].rel==rel){
					return viewMods[n];
				}
			}
		}
		
	 }
	/**
	 * 类：viewMod
	 * 参数：el为dom元素,net为关系链
	 * 描述：以特定dom元素封装一个viewMod实例，用于建立关系链
	 * 注意：每个viewMod对应的dom内的back类或goto类元素已自动绑定事件
	 * 基库：xhr
	 */
	QST.viewMod=function(el,net){
		this.el=el;
		this.rel=el.getAttribute('rel');
		this.parentRel=null;
		this.parentViewMod=null;
		this.backBtns=el.querySelectorAll('.back');//默认选取back类的链接作为返回按钮
		this.gotoBtns=el.querySelectorAll('.goto');//默认选取goto类的链接作为前往按钮
		this.updateArea=el.querySelector('.view_mod_content');//默认选取view_mod_content类为ajax更新区域
		this.onBeforeAjaxUpdate=function(){}
		this.onAfterAjaxUpdate=function(){}
		this.onInShow=function(){}
		this.onOutShow=function(){}
		//根据传进来的链接更新指定内容区
		var selt=this;
		this.updateByHref=function(url,callback,befroeCall){
			if(this.updateArea){
				befroeCall?befroeCall(selt):null;
				var xhr=new QST.xhr({
					method:'get',
					url:url,
					onSucceed: function (e) {
						if(!callback){
							selt.updateArea.innerHTML=e.target.responseText;//AJAX
						}else{
							callback(selt,e);
						}
					},
					onError: function (e) {dump(e.target.responseText);}
				});
				xhr.send();
			}else{
				throw new Error('view_mod_content类div未定义');
			}
		}
		this.init=function(){
			//this.hide();
			var selt=this;
			this.parentRel=this.rel.substring(0,this.rel.lastIndexOf('_'));
			for(var i=0;i<this.backBtns.length;i++){
				var backBtn=this.backBtns[i];
				var clickTouch=function(e){
					e.stopPropagation();
					e.preventDefault();
					net.inViewMod=selt;
					net.back();
					return false;
				}
				if(typeof backBtn.ontouchstart=='object'){
					backBtn.ontouchstart=clickTouch;
				}else{
					backBtn.onclick=clickTouch;
				}

			}
			for(var i=0;i<this.gotoBtns.length;i++){
				var gotoBtn=this.gotoBtns[i];
				var clickTouch=function(e){
					e.stopPropagation();
					e.preventDefault();
					net.goto(this.getAttribute('rel'),this.getAttribute('href'));
					return false;
				}
				if(typeof gotoBtn.ontouchstart=='object'){
					gotoBtn.ontouchstart=clickTouch;
				}else{
					gotoBtn.onclick=clickTouch;
				}
			}
		}
		this.init();
	}
	/**
	 * 类：QST.listenScrollPageMods
	 * 参数：exp[string] css选择器表达式
	 * 描述：用于监听指定元素，改变其结构使其可用于iScroll类,默认监听class为scroll_page_mod的元素
			页面直接定义如下可自动检测：
			<div class="scroll_page_mod" rel="ajax.php?a=b&c=d">
			内容...
			</div>
	 * 基库：html5,iScroll,scrollPageMod
	 */
	QST.listenScrollPageMods=function(exp){
		//取出所有元素
		var els=document.querySelectorAll(exp);
		//用于记录当前页面含有的页码组件元素
		if(window.QST.pageModElements==null){
			window.QST.pageModElements=[];
		}
		this.pageModElements=[];
		for(var i=0;i<els.length;i++){
			var tempHtml=els[i].innerHTML;
			els[i].style.cssText='position:relative;z-index:1;overflow:hidden;';
			var rel=els[i].getAttribute('rel');
			rel=(rel==null?'':rel);
			//如果有定义rel则带ajax功能
			if(rel!=''){
				els[i].innerHTML='<div class="scroller"><div class="update"><span class="word default_loading">拉开以刷新...</span><span class="arrow"></span></div><div class="content">'+tempHtml+'</div><div class="update_down"><span class="word default_loading">载入更多...</span><span class="arrow"></span></div></div>';
				var s=new QST.scrollPageMod(els[i].querySelector('.scroller'),{
					method:'get',
					url:rel
				});
			}else{
				els[i].innerHTML='<div class="scroller"><div class="content">'+tempHtml+'</div></div>';
				var s=new QST.scrollPageMod(els[i].querySelector('.scroller'),{
					method:'get',
					url:rel,
					ajaxed:false
				});
			}
			if(els[i].id){
				window.QST.pageModElements[els[i].id]=s;
				this.pageModElements[els[i].id]=s;
			}else{
				window.QST.pageModElements.push(s);
				this.pageModElements.push(s);
			}
			
		}
	}
	/**
	 * 方法：QST.selectPageMod
	 * 参数：id[string] 元素id
	 * 描述：指向一个pagemod实例
	 * 基库：html5,iScroll,scrollPageMod，listenScrollPageMods
	 */
	QST.getScrollPageMod=function(id){
		if(window.QST.pageModElements[id]){
			return window.QST.pageModElements[id];
		}else{
			throw new Error('没有定义id为：'+id+'的pageMod组件');
		}
	}
	/**
	 * 类：QST.scrollPageMod
	 * 参数：1.exp[string/dom element] //css选择器表达式或dom元素 
			2.options = {
				method:'get',//抛送方式
				url:'',//抛送连接，【默认以get形式传递了page参数】，“载入更多”按钮默认获取下一页码的数据，该链接应该返回li列表（不带ul）
				ars:{},//ars为传递参数，意味在post形式下默认抛了一个叫contentInJsonSring参数（值为ars对象）
				ajaxed:true,//是否有ajax请求,默认有
				onUpAjaxBack:function(){},
				onDownAjaxBack:function(){}
			}
	 * 描述：用于给固定结构的dom赋予iScorll类，并绑定ajax
	 * 事件：onUpBack上端更新时触发事件，onDownBack下端更新时触发事件
	 * 注意：对应html结构
			 <div id="wrapper" rel="ajax.php">
				<div id="scroller" class="scroller">
					<div class="update"><span class="word default_loading">拉开以刷新...</span></div>
					<ul class="content">
					</ul>
					<div class="update_down"><span class="word default_loading">载入更多...</span></div>
				</div>
			</div>
	 * 基库：html5,iscroll
	 */
	QST.scrollPageMod=function(exp,options) {
		
		if(typeof exp=='string'){
			exp=document.querySelector(exp);
		}
		if(exp==null){
			return;
		}
		var selt=this;
		selt.options = {
			method:'get',
			url:'',
			ajaxed:true,
			ars:{},
			lazyload:true,
			onUpAjaxBack:function(selt,e){},
			onDownAjaxBack:function(selt,e){}
		}
		//可用于外部重置option
		this.setOptions=function(options){
			
			// 用户配置
			if (typeof options == 'object') {
				for (i in options) {
					if(typeof selt.options[i]!=typeof options[i]){
						throw new Error(i+" 需要是 "+typeof selt.options[i]);
					}else{
						selt.options[i] = options[i];
					}
				}
			}
		}
		this.setOptions(options);
		this.onUpAjaxBack=selt.options.onUpAjaxBack;
		this.onDownAjaxBack=selt.options.onDownAjaxBack;
		//图片延迟加载
		if(selt.options.lazyload){
			//scroll元素以及content都有偏移
			selt.lazyLoad=new QST.imageLazyLoadMod(exp.parentNode,{t3dEl:[exp,exp.querySelector('.content')]});
		}
		//如果不需要ajax，则直接定义一个滚动组件，并返回
		if(!selt.options.ajaxed){
			this.myScroll = new iScroll(exp, {
				desktopCompatibility:true,
				checkDOMChanges:false,
				onScrollEnd: function () {
					//图片延迟加载
					if(selt.lazyLoad){
						selt.lazyLoad.init();
					}
					//
				}
			})
			return;
		}
		//以下是带ajax功能的组件
		this.wordEl=null;
		this.updateEl=null;
		this.updateElDown=null;
		this.contentEl=null;
		this.page=0;//第几页数据
		this.onAjaxUpdate=function(e){}
		//页面控制
		this.nextPage=function(){
			this.page++;
			return this.page;
		}
		this.initPage=function(){
			this.page=1;
			return 1;
		}
		this.wrapper=exp.parentNode;
		this.wordEl=exp.querySelector('.update .word');
		this.updateEl=exp.querySelector('.update');
		this.updateElHeight=this.updateEl.offsetHeight;
		this.updateElDown=exp.querySelector('.update_down');
		this.updateElDown.style.visibility="hidden";
		//底部载入更多事件
		this.updateElDown.addEventListener('click',function(){
			var me=this;
			if(!me.updating){
				me.querySelector('.word').innerText="正在载入中...";
				me.querySelector('.word').className="word now_loading";
				me.updating=true;
				//ajax
				var req=new QST.xhr({
					method:selt.options.method,
					url:selt.options.url+'?page='+selt.nextPage(),//默认请求第一页
					onError:function(e){
						//dump(e);
						alert('数据返回错误');
					},
					onSucceed:function(e){
						//selt.contentEl.innerHTML+=(e.target.responseText);
						selt.onDownAjaxBack(selt,e);
						me.querySelector('.word').innerText="载入更多...";
						//修复字体不同步 开始
						var tempColor=me.querySelector('.word').style.backgroundColor;
						me.querySelector('.word').style.backgroundColor='rgba(0,0,0,.1)';
						setTimeout(function(){
							me.querySelector('.word').style.backgroundColor=tempColor;
						},0);
						//修复字体不同步 结束
						me.querySelector('.word').className="word default_loading";
						me.querySelector('.word').style.webkitTransitionProperty="none";
						me.updating=false;
						if(selt.lazyLoad){
							selt.lazyLoad.init();
						}
					}
				});
				req.send(null);
			}
		}, false);

		
		this.contentEl=exp.querySelector('.content');
		
		this.myScroll = new iScroll(exp, {
			desktopCompatibility:true,
			checkDOMChanges:false,
			onScrollEnd: function () {
				//图片延迟加载
				if(selt.lazyLoad){
					selt.lazyLoad.init();
				}
				//
			},
			onTouchMove:function(topDelta){
				if(!this.updating){
					this.updateOffSet=topDelta;
					//document.getElementById('console').innerHTML=this.updateOffSet;
					if(this.updateOffSet>selt.updateElHeight){
						selt.setBeforeUpdate();
					}else{
						selt.setDefaultUpdate();
					}
				}
			},
			onTouchStart:function(){
				//document.getElementById('console').innerHTML+='b';
			},
			onTouchEnd:function(){
				if(this.updateOffSet>selt.updateElHeight){
					this.updating=true;
					selt.setUpdating();
					this.setPosition(0,this.updateOffSet-selt.updateElHeight,true);
					this.refresh();
					this.updateOffSet=0;
					
					var tempThis=this;
					this.statusBack=function(){
						tempThis.updating=false;
						tempThis.resetPosition();
						tempThis.refresh();
						selt.setDefaultUpdate();
						tempThis.maxScrollY+=selt.updateElHeight;
						if(tempThis.scrollBarY!=null){
							var h=tempThis.scrollBarY.bar.style.height;
							tempThis.scrollBarY.bar.style.height=parseInt(h,10)+selt.updateElHeight+'px';
						}
					}
					//ajax

					selt.sendAjax(
						function(){tempThis.statusBack();},
						function(){tempThis.statusBack();}
					);
				}
			}
		});
		//callback为更新完后执行的函数,errorback为错误后执行函数
		this.sendAjax=function(callback,errorback,async){
			if(selt.options.url=='about:blank'||selt.options.url==''){
				return;
			}
			var newUrl=selt.options.url+'&page=1';
			var req=new QST.xhr({
				async:typeof(async)!='undefined'?async:true,
				method:selt.options.method,
				url:newUrl,//默认请求第一页
				onError:function(e){
					//dump(e);
					if(errorback){
						errorback(e);
					}
				},
				onSucceed:function(e){
					//当前页为第一页
					selt.initPage();
					//selt.contentEl.innerHTML=(e.target.responseText);
					
					selt.updateElDown.style.visibility="visible";
					selt.onUpAjaxBack(selt,e);
					
					
					if(callback){
						callback(e);
					}
					//图片延迟加载
					if(selt.lazyLoad){
						selt.lazyLoad.init();
					}
					selt.myScroll.element.style.webkitTransform='';
					selt.myScroll.refresh();
					selt.myScroll.scrollTo(0,0,0);
				}
			});
			//req.setHeader('Content-Type', 'application/x-www-form-urlencoded');
			req.send('contentInJsonSring='+JSON.stringify(selt.options.ars));//以json形式发送内容区元素
			//req.send();
			return req;
		}
		//this.sendAjax();//首次加载
		//changeAndSend改变数据源并且发送更新
		this.changeAndSend=function(newUrl,callback,errorback,async){
			if(this.changeSource(newUrl)){
				return selt.sendAjax(callback,errorback,async);
			}
		}
		//改变数据源
		this.changeSource=function(newUrl){
			if(newUrl){
				selt.options.url=newUrl;
				exp.parentNode.setAttribute('rel',newUrl);
				return true;
			}
			return false;
		}
		//刷新
		this.refresh=function(){
			selt.sendAjax();
		}
		//console.log(this.myScroll.maxScrollY);
		this.setDefaultUpdate=function(){
			this.wordEl.innerText='拉开以刷新...';
			this.wordEl.className='word default_loading';
			//this.updateEl.style.marginTop="-"+selt.updateElHeight+"px";
			//this.updateEl.style.webkitTransitionProperty="margin";
			this.updateEl.style.webkitTransform="translate3d(0px, -"+selt.updateElHeight+"px, 0px)";
			this.updateEl.style.webkitTransitionProperty="-webkit-transform";
			this.contentEl.style.webkitTransform="translate3d(0px, -"+selt.updateElHeight+"px, 0px)";
			this.contentEl.style.webkitTransitionProperty="-webkit-transform";
			this.updateElDown.style.webkitTransform="translate3d(0px, -"+selt.updateElHeight+"px, 0px)";
			this.updateElDown.style.webkitTransitionProperty="-webkit-transform";
		}
		this.setDefaultUpdate();
		this.setBeforeUpdate=function(){
			this.wordEl.innerText='松开即可更新...';
			this.wordEl.className='word before_loading';
			//this.updateEl.style.marginTop="-"+selt.updateElHeight+"px";
			//this.updateEl.style.webkitTransitionProperty="none";
			this.updateEl.style.webkitTransform="translate3d(0px, -"+selt.updateElHeight+"px, 0px)";
			this.updateEl.style.webkitTransitionProperty="none";
			this.contentEl.style.webkitTransform="translate3d(0px, -"+selt.updateElHeight+"px, 0px)";
			this.contentEl.style.webkitTransitionProperty="none";
			this.updateElDown.style.webkitTransform="translate3d(0px, -"+selt.updateElHeight+"px, 0px)";
			this.updateElDown.style.webkitTransitionProperty="none";
		}
		this.setUpdating=function(){
			this.wordEl.innerText='正在更新...';
			this.wordEl.className='word now_loading';
			//this.updateEl.style.marginTop="0px";
			//this.updateEl.style.webkitTransitionProperty="none";
			this.updateEl.style.webkitTransform="translate3d(0px, -"+0+"px, 0px)";
			this.updateEl.style.webkitTransitionProperty="none";
			this.contentEl.style.webkitTransform="translate3d(0px, -"+0+"px, 0px)";
			this.contentEl.style.webkitTransitionProperty="none";
			this.updateElDown.style.webkitTransform="translate3d(0px, -"+0+"px, 0px)";
			this.updateElDown.style.webkitTransitionProperty="none";
		}
		
		
	}
	/**
	 * 类：QST.listenCoverFlowMods
	 * 参数：exp[string] css选择器表达式
	 * 描述：用于监听指定元素，改变其结构使其可用于iScroll类,默认监听class为cover_flow_mod的元素
			页面直接定义如下可自动检测：
			<div class="cover_flow_mod" rel="ajax.php?a=b&c=d" pagecount="3">
			内容...
			</div>
	 * 基库：html5,iScroll,coverFlowMod
	 */
	QST.listenCoverFlowMods=function(exp){
		//取出所有元素
		var els=document.querySelectorAll(exp);
		//用于记录当前页面含有的页码组件元素
		if(window.QST.coverFlowModElements==null){
			window.QST.coverFlowModElements=[];
		}
		this.coverFlowModElements=[];
		for(var i=0;i<els.length;i++){
			
			var s=new QST.coverFlowMod(els[i]);
			//假如有id自动注册一个元素，假如没有则直接追加一个
			if(els[i].id){
				window.QST.coverFlowModElements[els[i].id]=s;
				this.coverFlowModElements[els[i].id]=s;
			}else{
				window.QST.coverFlowModElements.push(s);
				this.coverFlowModElements.push(s);
			}
		}
	}
	/**
	 * 方法：QST.getCoverFlowMod
	 * 参数：id[string] 元素id
	 * 描述：指向一个coverFlowmod实例
	 * 基库：html5,iScroll,coverFlowMod,listenCoverFlowMods
	 */
	QST.getCoverFlowMod=function(id){
		if(window.QST.coverFlowModElements[id]){
			return window.QST.coverFlowModElements[id];
		}else{
			throw new Error('没有定义id为：'+id+'的coverFlowMod组件');
		}
	}
	/**
	 * 类：coverFlowMod
	 * 参数：exp为选择器，可以为dom也可以为字符串
			options = {
				pagecount:10,//初始页数,假如定义cover_flow_mod_item，则自动检测页数
				maxPage:10,//最大页数
				url:ajax.php//数据源
			}
	 * 事件：onAfterUpdate 在每次更新数据后触发的事件
	 * 描述：生成一个滚屏页码组件对象
	 * 注意：
	 * 基库：html5,iScroll,xhr
	 */
	QST.coverFlowMod=function(exp,options){
		if(typeof exp=='string'){
			exp=document.querySelector(exp);
		}
		if(exp==null){
			return;
		}
		var selt=this;
		
		selt.options = {
			maxPage:10,
			method:'get',
			url:(exp.getAttribute('rel')?exp.getAttribute('rel'):''),
			ars:{},
			itemClassName:'cover_flow_mod_item',
			onBeforeUpdate:function(selt){return true;},//ajax更新前,返回真才执行后续默认操作,默认继续执行
			onAfterUpdate:function(selt,e){return true;},//ajax更新完毕时,返回真才执行后续默认操作,默认继续执行
			onScrollEnd:function(selt,e){}//滚动完成时
		}

		//可用于外部重置option
		selt.setOptions=function(options){
			// 用户配置
			if (typeof options == 'object') {
				for (i in options) {
					if(typeof selt.options[i]!=typeof options[i]){
						throw new Error(i+" 需要是 "+typeof selt.options[i]);
					}else{
						selt.options[i] = options[i];
					}
				}
			}
		}
		selt.setOptions(options);
		selt.onBeforeUpdate=selt.options.onBeforeUpdate//ajax更新前
		selt.onAfterUpdate=selt.options.onAfterUpdate//ajax更新完毕时
		selt.onScrollEnd=selt.options.onScrollEnd//滚动完成时
		
		
		//从新构造html
		var tempHtml=exp.innerHTML;

		exp.innerHTML='<div class="cover_flow_mod_warp"><div class="cover_flow_mod_scroller">'+tempHtml+'</div></div><div class="cover_flow_mod_nav"><span class="cover_flow_mod_nav_prev">prev</span><ul class="cover_flow_mod_nav_indicator"></ul><span class="cover_flow_mod_nav_next">next</span></div>';
		
		//
		
		selt.wrap=exp.querySelector('.cover_flow_mod_warp');
		selt.scroller=exp.querySelector('.cover_flow_mod_scroller');
		//滚动条宽度必须为父节点的N倍
		selt.scroller.style.width=selt.wrap.offsetWidth*selt.options.pagecount+'px';
		selt.indicator=exp.querySelector('.cover_flow_mod_nav_indicator');
		selt.prev=exp.querySelector('.cover_flow_mod_nav_prev');
		selt.next=exp.querySelector('.cover_flow_mod_nav_next');
		selt.prev.ontouchstart=function(e){e.preventDefault();e.stopPropagation();selt.myScroll.scrollToPage('prev',0)}
		selt.next.ontouchstart=function(e){e.preventDefault();e.stopPropagation();selt.myScroll.scrollToPage('next',0)}

		//scroll组件
		selt.updating=false;
		//如果没有定义url或者url为空
		selt.myOnScrollEnd=null;
		if(!selt.options.url){
			selt.myOnScrollEnd=function(){
				selt.indicator.querySelector('li.active').className = '';
				selt.indicator.querySelector('li:nth-child(' + (this.pageX+1) + ')').className = 'active';
			}
		}else{
			//发送请求更新
			selt.myOnScrollEnd=function(){
				selt.onScrollEnd(selt);
				//达到最后一页的时候,发送Ajax请求
				if(this.pageX+1==selt.options.pagecount&&this.pageX+1<selt.options.maxPage&&!selt.updating){
					if(!selt.onBeforeUpdate(selt))
						return;
					
					selt.updating=true;
					var me=this;
					var xhr=new QST.xhr({
						method:'get',
						url:selt.options.url+'&page='+(me.pageX+1),
						onSucceed: function (e) {
							if(selt.onAfterUpdate(selt,e)){
								var c=selt.options.pagecount;
								selt.reset({initPage:c});
							}
							
						}
					});
					xhr.send();
				}
				selt.indicator.querySelector('li.active').className = '';
				selt.indicator.querySelector('li:nth-child(' + (this.pageX+1) + ')').className = 'active';
			}
		}
		selt.myScroll = new iScroll(selt.scroller, {
			snap:true,
			desktopCompatibility:true,
			momentum:false,
			hScrollbar:false,
			onScrollEnd:selt.myOnScrollEnd
		});
		//重置
		selt.reset=function(myOptions){
			var initOptions={
				initPage:1,
				url:'',
			}
			for (i in myOptions) {
				initOptions[i] = myOptions[i];
			}
			selt.updating=false;
			//假如url被更改则改变数据源
			if(initOptions.url!=''){
				selt.changeSource(initOptions.url);
			}
			var newcount=exp.querySelectorAll('.'+selt.options.itemClassName).length;//初始化显示页数
			//限制总页数
			newcount=(newcount>selt.options.maxPage?selt.options.maxPage:newcount);
			newcount=newcount<1?1:newcount;
			
			//假如有设置newcount页数，则不使用默认的类元素个数作为页数
			selt.options.pagecount=newcount;
			//限制初始页码
			initOptions.initPage=initOptions.initPage>newcount?newcount:initOptions.initPage;
			initOptions.initPage=initOptions.initPage<1?1:initOptions.initPage;
			//加li
			var lis='';
			for(var m=0;m<selt.options.pagecount;m++){
				lis+=(m==initOptions.initPage-1?'<li class="active">':'<li>')+(m+1)+'</li>';
			}
			selt.indicator.innerHTML=lis;
			
			selt.scroller.style.width=parseInt(selt.wrap.offsetWidth)*(newcount)+'px';
			selt.myScroll.refresh();
			selt.myScroll.scrollToPage(initOptions.initPage-1,0,0);
			//假如初始页是最后一页，则自动发一次请求
			if(initOptions.initPage==newcount){
				try{
					selt.myOnScrollEnd.call(selt.myScroll);
				}catch(err){
					//dump(err);
				}
			}
		}
		
		selt.reset({initPage:1});
		
		

		selt.changeSource=function(newUrl){
			selt.options.url=newUrl;
			exp.setAttribute('rel',newUrl);
		}
		return;
	}
	/**
	 * 类：imageLazyLoadMod
	 * 参数：exp为dom也可以为字符,意为：其内需要预加载图片
			options = {
				attr:'_lazysrc',//保存原图地址的自定义属性，img标签需要自定义预加载地址，src可以放一个空白占位图
				t3dEl:null//translate3d偏移元素，用于纠正位置，dom元素,或dom元素数组,因为图片所在html中可能父层被translate3d偏移过
			}
	 * 描述：延迟加载组件，用于图片的lazyload
	 * 注意：直接用实例的init方法可监测指定容器的图片
	 * 用法：定义一个预加载组件，然后通过调用他的init方法来对指定容器的图片进行选择性加载（即出现在可视区的图片）,每调用一次init方法加载一次
	 */
	QST.imageLazyLoadMod=function(exp,options){
		if(typeof exp=='string'){
			exp=document.querySelector(exp);
		}
		if(exp==null){
			return;
		}
		var selt=this;
		selt.options = {
			attr:'_lazysrc',//保存原图地址的自定义属性
			t3dEl:null//translate3d偏移元素，用于纠正位置，dom元素,或dom元素数组,因为图片所在html中可能父亲偏移过
		}
		//可用于外部重置option
		selt.setOptions=function(options){
			// 用户配置
			if (typeof options == 'object') {
				for (i in options) {
					if(typeof selt.options[i]!=typeof options[i]){
						throw new Error(i+" 需要是 "+typeof selt.options[i]);
					}else{
						selt.options[i] = options[i];
					}
				}
			}
		}
		selt.setOptions(options);
		//
		selt.getTranslate3d=function(p){
			if(selt.options.t3dEl!=null){
				if(selt.options.t3dEl.length!=null){
					var els=selt.options.t3dEl;
				}
				else{
					var els=[selt.options.t3dEl];
				}
				
				var offsetY=0;
				var offsetX=0;
				for(var i=0;i<els.length;i++){
					
					var str=document.defaultView.getComputedStyle(els[i], null).webkitTransform;
					//假如设置webkitTransform属性
					if(str!='none'){
						str=str.replace('(','[');
						str=str.replace('matrix','');
						str=str.replace(')',']');
						var temparr=eval(str);
						offsetY+=temparr[5];
						offsetX+=temparr[4];
					}
				}
				
				if(p=='x')
					return offsetX;
				if(p=='y')
					return offsetY;
			}else{
				return 0;
			}
			
		}
		selt.images=exp.getElementsByTagName('IMG');
		selt.init=function(){
			//alert(selt.getTranslate3d('x'));
			//先给所有img的父层加loading类
			for(var i=0;i<selt.images.length;i++){
				var img=selt.images[i];
				if(img.getAttribute(selt.options.attr)&&img.className.replace('img_loading_status','')==img.className){
					img.className+=' img_loading_status';
				}
			}
				
			selt.initTimeout=setTimeout(function(){
				for(var i=0;i<selt.images.length;i++){
					var img=selt.images[i];
					img.onload=null;
					//if(img.getAttribute(selt.options.attr)&&img.offsetTop-exp.scrollTop+selt.getTranslate3d('y')<exp.clientHeight&&img.offsetLeft-exp.scrollLeft+selt.getTranslate3d('x')<exp.clientWidth){
					var rect=img.getBoundingClientRect();
					if(img.getAttribute(selt.options.attr)&&rect.left<window.innerWidth&&rect.top<window.innerHeight){
						img.setAttribute('src',img.getAttribute(selt.options.attr));
						img.removeAttribute(selt.options.attr);
						img.onload=function(){
							this.parentNode.className=this.parentNode.className.replace(/ img_loading_status/g,'');
						}
					}
				}
				clearTimeout(selt.initTimeout);
			},500);
			
		}
		selt.init();
		
		exp.addEventListener('size' in window ? 'orientationchange' : 'resize', function(){
			selt.init();
		}, false);
		exp.addEventListener('webkitTransitionEnd', function(){
			selt.init();
		}, false);
		exp.addEventListener('scroll', function(){
			selt.init();
		}, false);
	}
	/**
	 * 基类：QST.loadingMod
	 * 作者：JOE
	 * 版本：Version 1.0 2011.3.12
	 * 注意：仿mvc模式
	 * 基库：无
	 */
	QST.loadingMod=function(options){
		var selt=this;
		selt.options = {
			note:'加载中...',
			style:1,
			delay:500,
			xhr:null,//xhr对象，请尽量指定这个
			timeout:10,//10秒证明链接失效
			timeslow:5//5秒的时候提示
		}
		//可用于外部重置option
		selt.setOptions=function(options){
			for (i in options) {
				selt.options[i] = options[i];
			}
		}
		selt.setOptions(options);
		selt.view=function(){
			selt.wrapper=document.createElement('DIV');
			selt.wrapper.className="loading_mod loading_mod_off_1 loading_mod_style_"+selt.options.style;
			selt.wrapper.innerHTML="<span class='loading_mod_note'>加载中...</span>";
			selt.note=selt.wrapper.querySelector('.loading_mod_note');
			selt.timmer={
				timepass:0,
				timeread:null,
				set:function(){
					selt.timmer.timeread=setInterval(function(){
						selt.timmer.timepass++;
						if(selt.timmer.timepass>=selt.options.timeslow&&selt.timmer.timepass<selt.options.timeout){
							selt.note.innerText="龟速网络?..";
							selt.note.className+=' loading_mod_note_slow';
						}
						if(selt.timmer.timepass>=selt.options.timeout){
							selt.note.innerText="网络异常...";
							selt.note.className+=' loading_mod_note_timeout';
							selt.timmer.clear();
							selt.end();
							try{
								selt.options.xhr.close();
							}catch(err){
								dump(err);
							}
						}
						
					},1000);
				},
				clear:function(){
					clearTimeout(selt.timmer.timeread);
					selt.timmer.timepass=0;
				}
			};
		}
		selt.model=function(){
			selt.start=function(){
				//开始计时
				selt.timmer.set();
				document.querySelector('body').appendChild(selt.wrapper);
				var name=selt.wrapper.className;
				setTimeout(function(){
					selt.wrapper.className=name.replace('loading_mod_off_1','loading_mod_on');
				},0);	
				
			}
			selt.end=function(){
				setTimeout(function(){
					var name=selt.wrapper.className;
					selt.wrapper.className=name.replace('loading_mod_on','loading_mod_off_2');
					var note=selt.wrapper.querySelector('.loading_mod_note');
					var tmpfun=function(){
						var name=selt.wrapper.className;
						selt.wrapper.className=name.replace('loading_mod_off_2','loading_mod_off_1');
						selt.wrapper.parentNode.removeChild(selt.wrapper);
						note.removeEventListener('webkitTransitionEnd', tmpfun, false);
						selt.timmer.clear();
					}
					note.addEventListener('webkitTransitionEnd', tmpfun, false);
				},selt.options.delay)
			}
		}
		selt.controll=function(){
			
		}
		selt.view();
		selt.model();
	}
	/**
	 * 基类：QST.xhr
	 * 作者：JOE
	 * 版本：Version 1.0 2011.3.12
	 * 注意：url已使用了?要带参数直接加&
	 * 基库：无
	 */
	QST.xhr=function(options){
		var xhrThis=this;
		//m为post或get,async为是否异步，ars是传递变量
		xhrThis.options = {
			method:'get',
			url:'',
			async:true,
			loadingModed:false,
			onSucceed: function (e) {},
			onError: function (e) {}
		}
		// User defined options
		if (typeof options == 'object') {
			for (i in options) {
				xhrThis.options[i] = options[i];
			}
		}
		//如果url为空，不需要发请求
		if(xhrThis.options.url==''){
			return;
		}
		xhrThis.xmlhttp=new XMLHttpRequest();
		var newUrl=xhrThis.options.url+'&rand='+Date.parse(new Date());
		newUrl=newUrl.replace(/\?/g,'\&');
		newUrl=newUrl.replace(/\&/,'\?');
		xhrThis.xmlhttp.open(xhrThis.options.method,newUrl,xhrThis.options.async);
		xhrThis.xmlhttp.onreadystatechange=function(e){
			if (this.readyState==4){
				if (this.status==200){
					//假如有loading组件
					if(loading){
						loading.end();
					}
					xhrThis.options.onSucceed(e);
				}
				else{
					xhrThis.options.onError(e);
				}
			}
		}
		//假如用了Loading组件
		if(xhrThis.options.loadingModed&&QST.loadingMod){
			var loading=new QST.loadingMod({delay:200,xhr:this});
			dump(loading);
			loading.start();
		}
		xhrThis.send=function(ars){
			xhrThis.xmlhttp.send(ars);
		}
		xhrThis.setHeader=function(name,value){
			xhrThis.xmlhttp.setRequestHeader(name,value);
		}
		xhrThis.close=function(){
			xhrThis.xmlhttp.abort();
		}
	}
	/**
	 * 基类：无
	 * 作者：JOE
	 * 版本：Version 1.0 2011.4.18
	 * 注意：实例化的时候只要mode是timeout的话，不需要后续操作。如果是lazy则需要通过recover方法来恢复所有元素状态，仿mvc模式
	 * 基库：无
	 */
	QST.eventLazyEffectMod=function(options){
		var selt=this;
		selt.source=function(){
			selt.options = {
				els:'a,button',//可以为元素数组集
				lightedClassName:'lighted_TLEM',//过渡加亮类名
				mode:'timeout',//timeout为延迟指定时间隐藏，lazy为后续提醒隐藏（即需要不同时期调用recover来回归状态）
				delay:500,//意为延迟多少秒还原,对lazy mode也有效
				event:'click',//事件
				onlyFistTime:false//是不是只执行一次
			}
			selt.setOption=function(options){
				if (typeof options == 'object') {
					for (i in options) {
						selt.options[i] = options[i];
					}
				}
				
			}
			selt.setOption(options);
			//类公用方法
			selt.setClick=function(el,fun){
				var event=selt.options.event;
				if(typeof el.ontouchstart!='object'&&event=='touchstart'){
					//el.ontouchstart=fun;
					event='click';
				}
				var tempfun=function(){
					fun.call(this);
					if(selt.options.onlyFistTime)
					el.removeEventListener(selt.options.event,tempfun,false);
				}
				
				el.addEventListener(event,tempfun,false);
				return fun;
			}
		}
		selt.view=function(){
			selt.els=(typeof selt.options.els=='string')?document.querySelectorAll(els):selt.options.els;
		}
		selt.module=function(){
			//根据模式赋予事件
			switch (selt.options.mode){
				case 'timeout':
					for(var i=0;i<selt.options.els.length;i++){
						selt.setClick(selt.options.els[i],function(){
							var me=this;
							var oldName=me.className;
							me.className+=(' '+selt.options.lightedClassName);
							setTimeout(function(){
								me.className=oldName;
							},selt.options.delay);
						});
					}
					break;
				case 'lazy':
					for(var i=0;i<selt.options.els.length;i++){
						selt.setClick(selt.options.els[i],function(){
							var me=this;
							me.className+=(' '+selt.options.lightedClassName);
						});
					}
					break;
			}
			//所有元素还原
			selt.recover=function(){
				for(var i=0;i<selt.els.length;i++){
					var me=selt.els[i];
					
					if(me.className.replace(selt.options.lightedClassName,'')!=me.className){
						
						(function(){
							var thisMe=me;
							setTimeout(function(){
								var reg=eval('/ '+selt.options.lightedClassName+'/g');
								thisMe.className=me.className.replace(reg,'');
							},selt.options.delay);
						})();
						
					}
				}
			}
		}
		selt.control=function(action,ars){
			try{
				eval('selt.'+action+'(ars);');
			}catch(e){
				throw new Error(e);
			}
		}
		selt.mv=function(){
			selt.source();
			selt.view();
			selt.module();
		}
		selt.mv();
	}
	/**
	 * 基类：无
	 * 作者：JOE
	 * 版本：Version 1.0 2011.4.21
	 * 用法：默认取得一个指定类名的导航
	 * 注意：仿mvc模式,可以通过实例的getBtnById来获取某个指定按钮，该按钮有一个事件方法为onBeforeEvent(defaultCallBack)该事件重写指定特定按钮在触发事件前操作，defaultCallBack为默认的回调变换方法（含绑定viewmodnet的切换）
	 * 基库：QST.eventLazyEffect,Mod QST.viewModNet
	 */
	QST.navMod=function(options){
		var selt=this;
		selt.source=function(){
			selt.options = {
				wrapperExp:'.navigator_mod',//指定一个元素（表达式或node）
				itemsExp:'.navigator_mod_item',//指定每个菜单元素集（表达式或node）,为表达式时自动查找wrapperExp里的元素
				currentName:'navigator_mod_current',//选中态类名
				backElName:'navigator_mod_back',//背景修饰元素类名
				viewModNet:null//可绑定一个viewmodnet实例
			}
			selt.setOption=function(options){
				if (typeof options == 'object') {
					for (i in options) {
						selt.options[i] = options[i];
					}
				}
				selt.options.wrapperExp=typeof(selt.options.wrapperExp)=='string'?document.querySelector(selt.options.wrapperExp):selt.options.wrapperExp;
				selt.options.itemsExp=typeof(selt.options.itemsExp)=='string'?selt.options.wrapperExp.querySelectorAll(selt.options.itemsExp):selt.options.itemsExp;
			}
			selt.setOption(options);
			//类公用方法
			selt.setEvent=function(el,event,fun){
				if(typeof el.ontouchstart!='object'&&event=='touchstart'){
					//el.ontouchstart=fun;
					event='click';
				}
				el.addEventListener(event,fun,false);
				return fun;
			}
		}
		selt.view=function(){
			selt.wrapperExp=selt.options.wrapperExp;
			if(selt.wrapperExp.className.replace('navigator_mod','')==selt.wrapperExp.className){
				selt.wrapperExp.className+=' navigator_mod';
			}
			selt.backEl=document.createElement('div');
			selt.backEl.className=selt.options.backElName;
			
			selt.wrapperExp.appendChild(selt.backEl);
			selt.itemsExp=selt.options.itemsExp;
			selt.currentEl=selt.wrapperExp.querySelector('.'+selt.options.currentName);//初始化
		}
		selt.module=function(){
			//按钮事件定义
			for(var i=0;i<selt.itemsExp.length;i++){
				var item=selt.itemsExp[i];
				item.nav_index=i;
				selt.setEvent(item,'touchstart',function(){
					var me=this;
					if(selt.currentEl!=me)
					me.onBeforeEvent(function(){
						selt.focus(me);
					});
					
				});
				//可覆盖函数，defaultCallBack为默认隐藏操作
				item.onBeforeEvent=function(defaultCallBack){
					//setTimeout(function(){
						defaultCallBack();
					//},1000);
				}
			}
			
			//获取特定id或序号按钮元素
			selt.getBtnById=function(id){
				for(var i=0;i<selt.itemsExp.length;i++){
					if(selt.itemsExp[i].id==id||id==i){
						return selt.itemsExp[i];
					}
				}
			}
			//取消指定按钮状态
			selt.blur=function(el){
				try{
					el.className=el.className.replace(eval('\/\\s\*'+selt.options.currentName+'\/g'),'');
				}catch(e){}
			}
			//激活指定按钮状态
			selt.focus=function(el){
				//if(el&&el.className.replace(eval('\/\\s\*'+selt.options.currentName+'\/g'),'')==el.className){
				if(el){
					//假如有绑定viewmodnet,并且按钮本身带rel
					if(selt.options.viewModNet&&el.getAttribute("rel")!=''){
						var vmn=selt.options.viewModNet;
						var direction='right';
						try{
							if(el.nav_index>selt.currentEl.nav_index){
								direction='left';
							}
						}catch(e){
							dump(e);
						}
						vmn.goto(el.getAttribute("rel"),null,null,null,direction);
					}
					//
					selt.blur(selt.currentEl);
					selt.currentEl=el;
					el.className+=(' '+selt.options.currentName);
				
					//背景元素跳到当前元素
					var addName=(' '+selt.options.backElName+'_first');
					selt.backEl.className=selt.backEl.className.replace(addName,'');
					var addName=(' '+selt.options.backElName+'_end');
					selt.backEl.className=selt.backEl.className.replace(addName,'');
					if(selt.currentEl.nav_index==0){
						var addName=(' '+selt.options.backElName+'_first');
						if(selt.backEl.className.replace(addName,'')==selt.backEl.className){
							selt.backEl.className+=addName;
						}
					}else if(selt.currentEl.nav_index==selt.itemsExp.length-1){
						var addName=(' '+selt.options.backElName+'_end');
						if(selt.backEl.className.replace(addName,'')==selt.backEl.className){
							selt.backEl.className+=addName;
						}
					}
					selt.backEl.style.webkitTransform="translate3d("+selt.currentEl.offsetLeft+"px,"+selt.currentEl.offsetTop+"px,0px)";
					selt.backEl.style.width=selt.currentEl.offsetWidth+'px';
					selt.backEl.style.height=selt.currentEl.offsetHeight+'px';
				}
				
			}
			selt.focus(selt.currentEl);
			//组件事件
			selt.addEvent=function(event,fun){
				
			}
		}
		selt.control=function(action,ars){
			//指初始化一次，其余时候需要初始化用_Refresh
			if(!selt.hasControll){
				selt.hasControll=true;
				selt.refresh(action,ars);
			}
		}
		selt.refresh=function(action,ars){
			try{
				eval('selt.'+action+'(ars);');
			}catch(e){
				throw new Error(e);
			}
		}
		selt.mv=function(){
			selt.source();
			selt.view();
			selt.module();
		}
		selt.mv();
	}

	/*以下为统一检测入口*/
	QST.ready(function(){
		//alert('a');
		//列表页面组件监测
		LSPM=new QST.listenScrollPageMods('.scroll_page_mod');
		LFSM=new QST.listenCoverFlowMods('.cover_flow_mod');
	});
})();

